package com.asc.mywriter.controller;

import com.asc.mywriter.bean.Product;
import com.asc.mywriter.serciceImpl.ProductServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class ProductController {

    @Autowired
    ProductServiceImpl productService;

    @ResponseBody
    @GetMapping("/product")
    public List<Product> findProduct(){
        return productService.findAll();
    }



}
